import type { DirectiveBinding, ImgHTMLAttributes } from "vue";

export const imageError = {
  //类型确定，先使用any，然后打印options，跳去源码找对应的字段名字
  mounted(el: ImgHTMLAttributes, options: DirectiveBinding) {
    // console.log(options);
    el.onError = () => {
      el.src = options.value;
    };
    el.src = options.value;
  },
};
